﻿@model LeadMaster.Models.Diary

@{
    ViewBag.Title = "Edit";
}
<div class="spacer"></div>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Edit Diary Entry</legend>
        <div class="spacer"></div>

        @Html.HiddenFor(model => model.DiaryID)
        @Html.HiddenFor(model => model.UserID)
        @Html.HiddenFor(model => model.LeadID)
        @Html.HiddenFor(model => model.ContactID)
        @Html.HiddenFor(model => model.CompanyID)

        <div class="bigsubmit">
            @Model.Contact.Forename @Model.Contact.Surname
        </div>

        <div class="bigsubmit">
            @Model.Contact.Company.Company
        </div>
        <div class="spacer"></div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Notes)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.Notes, new { @class = "notes" })
            @Html.ValidationMessageFor(model => model.Notes)
        </div>
        <div class="spacer"></div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ContactType)
        </div>
        <div class="editor-field">
            @Html.RadioButtonFor(model => model.ContactType, "E") Email
            @Html.RadioButtonFor(model => model.ContactType, "T") Telephone
            @Html.RadioButtonFor(model => model.ContactType, "M") Meeting
            @Html.RadioButtonFor(model => model.ContactType, "O") Other

            @Html.ValidationMessageFor(model => model.ContactType)
        </div>
        <div class="spacer"></div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Scheduled)
        </div>
        <div class="editor-field">
            <input type="text" id="Scheduled" name="Scheduled" class="datepicker" value="@(Model.Scheduled.ToShortDateString())" /> 
            @Html.ValidationMessageFor(model => model.Scheduled)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

<script src="~/Content/chosen/chosen.jquery.min.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {

        $(function () {
            $(".datepicker").datepicker({
                changeMonth: true,
                changeYear: true,
                yearRange: '-100',
                regional: 'en-GB',
                dateFormat: 'dd/mm/yy'
            });
        });
    });
</script>